Skip to content

Improve lexer_expect_object_literal_id option handling #2436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

rerobika
Copy link
Member

This patch allows to add further options flags to lexer_expect_object_literal_id to handle unique behaviors more easily
also substitutes PARSER_IS_CLASS flag hence it is removed.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]

@@ -379,7 +379,7 @@ parser_parse_class_literal (parser_context_t *context_p, /**< context */
lexer_skip_empty_statements (context_p);
}

lexer_expect_object_literal_id (context_p, false);
lexer_expect_object_literal_id (context_p, LEXER_OBJ_IDENT_CLASS_METHOD | LEXER_OBJ_IDENT_NO_OPTS);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LEXER_OBJ_IDENT_NO_OPTS ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, it is unnecessary.

@rerobika rerobika force-pushed the improve_expect_object_literal_id branch from 89e5115 to 2445998 Compare July 24, 2018 11:39
{
lexer_skip_spaces (context_p);

#ifndef CONFIG_DISABLE_ES2015_CLASS
int is_class_method = ((context_p->status_flags & PARSER_IS_CLASS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this flag still used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's no longer needed so it had been removed here.

@@ -68,7 +68,6 @@ typedef enum
PARSER_ARROW_PARSE_ARGS = (1u << 19), /**< parse the argument list of an arrow function */
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
#ifndef CONFIG_DISABLE_ES2015_CLASS
PARSER_IS_CLASS = (1u << 20), /**< statements parsed inside class body */
PARSER_CLASS_CONSTRUCTOR = (1u << 21), /**< a class constructor is parsed */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change 21 to 20 here.

Copy link
Member Author

@rerobika rerobika Jul 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've forgotten it.

This patch allows to add further options flags to `lexer_expect_object_literal_id` to handle unique behaviors more easily
also substitutes `PARSER_IS_CLASS` flag hence it is removed.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
@rerobika rerobika force-pushed the improve_expect_object_literal_id branch from 2445998 to 4d4bec7 Compare July 30, 2018 08:21
Copy link
Member

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LaszloLango LaszloLango merged commit a6ace5e into jerryscript-project:master Jul 30, 2018
legendecas added a commit to yodaos-project/ShadowNode that referenced this pull request Nov 29, 2018
legendecas added a commit to yodaos-project/ShadowNode that referenced this pull request Nov 29, 2018
legendecas added a commit to yodaos-project/ShadowNode that referenced this pull request Nov 29, 2018
@rerobika rerobika deleted the improve_expect_object_literal_id branch February 28, 2019 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants